﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.YAML.DictionaryFlowStyle
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Collections.Generic;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Serialization;


namespace DnProcessSimulateCommands.ExportToRTR.YAML;

public class DictionaryFlowStyle : IYamlConvertible
{
  public Dictionary<string, double> Data = new Dictionary<string, double>();

  public void Read(IParser parser, Type expectedType, ObjectDeserializer nestedObjectDeserializer)
  {
    this.Data = (Dictionary<string, double>) nestedObjectDeserializer.Invoke(typeof (Dictionary<string, double>));
  }

  public void Write(IEmitter emitter, ObjectSerializer nestedObjectSerializer)
  {
    emitter.Emit((ParsingEvent) new MappingStart(AnchorName.op_Implicit((string) null), TagName.op_Implicit((string) null), false, (MappingStyle) 2));
    foreach (KeyValuePair<string, double> keyValuePair in this.Data)
    {
      nestedObjectSerializer.Invoke((object) keyValuePair.Key, (Type) null);
      nestedObjectSerializer.Invoke((object) keyValuePair.Value, (Type) null);
    }
    emitter.Emit((ParsingEvent) new MappingEnd());
  }
}
